package com.admin.admindemo.pojo;

/**
 * @author 陈群矜
 */
public class Result<T> {

    private int code;

    private String message;

    private T data;

    public Result() {}

    public Result(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public static <T> Result<T> ok(T data) {
        Result<T> result = new Result<>(200, "ok");
        result.data = data;
        return result;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

}
